package xyz.ccola.controller;

import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
@Slf4j
@RequestMapping("/users")
public class UserController {

    @GetMapping("login")
    public String login(@RequestParam("username") String username,
                        @RequestParam("password") String password){
        log.info(username);
        log.info(password);
        if(!StringUtils.isEmpty(username) && "123456".equals(password)){
            return "index";
        }
        return "error-404";
    }
}
